realtek: use devm_kzalloc() for serdes debugfs setup
authorMarkus Stockhausen <[email protected]>
Sun, 14 Dec 2025 09:07:38 +0000 (10:07 +0100)
committerRobert Marko <[email protected]>
Mon, 15 Dec 2025 08:29:17 +0000 (09:29 +0100)
This will free memory automatically during driver unloading.

Signed-off-by: Markus Stockhausen <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/21157
Signed-off-by: Robert Marko <[email protected]>
target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto-serdes.c

index 394af71250b42c95c631c53a51842e65f0213fbf..5c8741383f80ea8aabf158605b30b65a04ea151a 100644 (file)
@@ -148,7 +148,7 @@ static int rtsds_debug_init(struct rtsds_ctrl *ctrl, u32 sds)
        struct dentry *dir, *root;
        char dirname[32];
 
-       dbg_info = kzalloc(sizeof(*dbg_info), GFP_KERNEL);
+       dbg_info = devm_kzalloc(ctrl->dev, sizeof(*dbg_info), GFP_KERNEL);
        if (!dbg_info)
                return -ENOMEM;